package demo;

import javanet.context.JavaNETDefaultFacadeContext;
import javanet.listener.JavaNETCommunicationEvent;
import javanet.listener.JavaNETCommunicationListener;

public class DemoListener implements JavaNETCommunicationListener {

	@Override
	public void beforeFacadeInvocationEvent(JavaNETCommunicationEvent event) {
		System.out.println("beforeFacadeInvocationEvent fired: " + event);
		System.out.println("... facade context: " + ((JavaNETDefaultFacadeContext)event.getFacadeContext()).getAppUserName());
	}

	@Override
	public void afterFacadeInvocationEvent(JavaNETCommunicationEvent event) {
		System.out.println("afterFacadeInvocationEvent fired: " + event);
	}

	@Override
	public void onException(JavaNETCommunicationEvent event) {
		System.out.println("onException fired: " + event);
	}

}
